From: Stefan Monnier Date: Wed, 25 Nov 2009 03:59:19 +0000 (+0000) Subject: (string-prefix-p): New function. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~9269 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=3500670478a9f9a1147a6287f2a51954d91afd26;p=emacs.git (string-prefix-p): New function. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0125c85b73..d02dbadd9ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2009-11-25 Stefan Monnier + * subr.el (string-prefix-p): New function. + * man.el (Man-completion-cache): New var. (Man-completion-table): Use it. diff --git a/lisp/subr.el b/lisp/subr.el index 2bc4c6b2bd2..9cbf4ab9ffc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3193,6 +3193,13 @@ and replace a sub-expression, e.g. (setq matches (cons (substring string start l) matches)) ; leftover (apply #'concat (nreverse matches))))) +(defun string-prefix-p (str1 str2 &optional ignore-case) + "Return non-nil if STR1 is a prefix of STR2. +If IGNORE-CASE is non-nil, the comparison is done without paying attention +to case differences." + (eq t (compare-strings str1 nil nil + str2 0 (length str1) ignore-case))) + ;;;; invisibility specs (defun add-to-invisibility-spec (element)